using System;
using System.Net;

namespace WebServiceClients
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Calling ASMX");
            WebServiceClients.dbvistaAsmx.WebService proxyAsmx = new WebServiceClients.dbvistaAsmx.WebService();
            proxyAsmx.Credentials = new NetworkCredential("alice", "abc!123");
            Console.WriteLine(proxyAsmx.Ping());

            Console.WriteLine();

            Console.WriteLine("Calling WCF");
            WebServiceClients.dbvistaWcf.WcfServiceClient proxyWcf = new WebServiceClients.dbvistaWcf.WcfServiceClient();
            proxyWcf.ClientCredentials.UserName.UserName = "alice";
            proxyWcf.ClientCredentials.UserName.Password = "abc!123";
            Console.WriteLine(proxyWcf.Ping());
        }
    }
}
